import { defHttp } from '/@/utils/http/axios';
import { ErrorMessageMode } from '/#/axios';

enum Api {
  ApiNLogsQuery = '/qc/log/getlatestapi/',
  ApiLogsQuery = '/qc/log/getapi/',
}

//  获取最新N条api日志详情

export const getNApiLogs = (params: { N: string }, mode: ErrorMessageMode = 'modal') => {
  return defHttp.get(
    {
      url: Api.ApiNLogsQuery + params,
    },
    {
      errorMessageMode: mode,
    },
  );
};
//  获取最新N条api日志详情

export const getApiLogs = (params: { id?: string }, mode: ErrorMessageMode = 'modal') => {
  return defHttp.get(
    {
      url: Api.ApiLogsQuery,
      params,
    },
    {
      errorMessageMode: mode,
      joinTime: false,
    },
  );
};
